package Sort;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] array = {12, 56, 32, 67, 10, 19, 4};
        test1(array);
        test2(array);
        test3(array);
        test4(array);
        test5(array);
        test6(array);
        test7(array);
        test8(array);
        test9(array);
        test10();
    }

    public static void test1(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.insertSort(array);
        System.out.println(" 插入排序的结果 : " + Arrays.toString(array));

    }

    public static void test2(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.shellSort(array);
        System.out.println(" 希尔排序的结果 : " + Arrays.toString(array));
    }

    public static void test3(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.selectSort1(array);
        //Sort.selectSort2(array);
        System.out.println(" 选择排序的结果 : " + Arrays.toString(array));
    }

    public static void test4(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.heapSort(array);
        System.out.println(" 堆的排序的结果 : " + Arrays.toString(array));
    }
    public static void test5(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.bubbleSort(array);
        System.out.println(" 冒泡排序的结果 : " + Arrays.toString(array));
    }
    public static void test6(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.quickSort(array);
        System.out.println(" 快排(递归)结果 : " + Arrays.toString(array));
    }
    public static void test7(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.quickSortNor(array);
        System.out.println(" 快排(非递归)结果:" + Arrays.toString(array));
    }
    public static void test8(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.mergeSort(array);
        System.out.println(" 归并排序的结果 : " + Arrays.toString(array));
    }
    public static void test9(int[] array) {
        array = Arrays.copyOf(array, array.length);
        Sort.mergeSortNor(array);
        System.out.println(" 归并非递归的结果 :" + Arrays.toString(array));
    }
    public static void test10() {
        int[] array={99,95,98,94,99,92,98,95,91,97,92};
        //适用于一组集中在一个范围得数据排序
        Sort.countSort(array);
        System.out.println(" 计数排序的结果 : "+Arrays.toString(array));
    }
}
